-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLVM] Encapsulate LLVM target for use with LLVM libraries #11933
Conversation
Thanks @kparzysz-quic . Reading the implementation it is unclear how |
The |
LLVMModule has two members that refer to llvm::Module: 1. llvm::Module* mptr_, and 2. std::unique_ptr<llvm::Module> module_. The mptr_ member is always valid and it points to the llvm::Module. The unique pointer takes care of the ownership of the llvm::Module, and deletes it when no longer needed. However, once JIT is initialized, it takes over the ownership of the llvm::Module, and the module_ member becomes null. To avoid checks for null, use the raw pointer whenever accessing the llvm::Module, and only use the unique_ptr as the owner/deleter.
@kparzysz-quic lmk when you need a review here--it's draft so i've been ignoring it |
This was a prototype/proof-of-concept that was evolving with the RFC, so the commit history is a bit messy. I replaced this by #12140. |
See apache/tvm-rfcs#83